# coding:utf-8
from __future__ import annotations

from enum import Enum
from typing import List, Optional

from pydantic import BaseModel


# noinspection PyPep8Naming, PyShadowingNames
class BusinessType(Enum):
    Dealer = 1
    SubDealer = 2
    FinancialLease = 3
    Manufacturer = 4
    Group = 5
    FlagshipStore = 6
    Custom = 7
    Platform = 8
    SecondHand = 9
    MarketAD = 10
    AfterSales = 11
    Trade = 12
    ExternalPlatform = 13
    ThirdAdx = 14
    Finance = 15
    AdDsp = 16
    CISN = 17
    Retail = 18
    EWDMS = 19
    Open = 20
    LeadsCenter = 100


# noinspection PyPep8Naming, PyShadowingNames
class AuthType(Enum):
    TT = 1
    DY = 2


# noinspection PyPep8Naming, PyShadowingNames
class SimpleReq(BaseModel):
    ...


# noinspection PyPep8Naming, PyShadowingNames
class OperateRsp(BaseModel):
    prompts: str
    status: int
    message: str
    data: bool
    ...


# noinspection PyPep8Naming, PyShadowingNames
class FWUser(BaseModel):
    fw_user_id: Optional[str]
    fw_user_name: Optional[str]
    fw_user_avatar: Optional[str]
    fw_user_phone: Optional[str]
    ad_user_id: Optional[str]
    tt_user_id: Optional[str]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class AccountInnerUser(BaseModel):
    user_name: Optional[str]
    role_name: Optional[str]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class EntranceAgreement(BaseModel):
    agreement_version: Optional[int]
    user_agreement_url: Optional[str]
    privacy_agreement_url: Optional[str]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class FWAccountLoginReq(BaseModel):
    fw_account_id: str
    entrance_sub_type: Optional[int]
    app_key: Optional[str]
    aid: Optional[int]
    fw_user_id: Optional[str]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class FWLoginReq(BaseModel):
    app_key: str
    aid: Optional[int]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class FWIsLoginReq(BaseModel):
    app_key: Optional[str]
    aid: Optional[int]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class FWAuthBindReq(BaseModel):
    auth_type: AuthType
    app_key: str
    ticket: str
    ...


# noinspection PyPep8Naming, PyShadowingNames
class AccessDialog(BaseModel):
    title: str
    text: str
    phone: str
    ...


# noinspection PyPep8Naming, PyShadowingNames
class AccessJump(BaseModel):
    open_url: str
    ...


# noinspection PyPep8Naming, PyShadowingNames
class BindData(BaseModel):
    auth_type: Optional[AuthType]
    user_id: Optional[str]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class GetBindTicketReq(BaseModel):
    auth_type: AuthType
    ...


# noinspection PyPep8Naming, PyShadowingNames
class GetBindTicketData(BaseModel):
    ticket: Optional[str]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class GetLogOffStatusData(BaseModel):
    status: Optional[int]
    is_tourist: Optional[bool]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class SendOperateVerifyCodeReq(BaseModel):
    operate_type: int
    ...


# noinspection PyPep8Naming, PyShadowingNames
class ApplyLogOffReq(BaseModel):
    verify_code: Optional[str]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class FWLoginWithSignReq(BaseModel):
    app_key: str
    phone: str
    aid: Optional[int]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class GetUserFWAccountReq(BaseModel):
    app_key: Optional[str]
    need_filter: Optional[bool]
    aid: Optional[int]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class AppUpdateData(BaseModel):
    should_upgrade: Optional[bool]
    force_upgrade: Optional[bool]
    prompts: Optional[str]
    url: Optional[str]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class UserFWAccount(BaseModel):
    fw_account_id: Optional[str]
    fw_business_type: Optional[int]
    fw_account_name: Optional[str]
    open_url: Optional[str]
    cur_identity: Optional[bool]
    business_outer_id: Optional[str]
    fw_account_icon: Optional[str]
    entrance_sub_type: Optional[int]
    fw_account_inner_user: Optional[AccountInnerUser]
    fw_user_id: Optional[str]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class AuthAccess(BaseModel):
    auth_type: int
    dialog_info: Optional[AccessDialog]
    jump_info: Optional[AccessJump]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class GetBindInfoData(BaseModel):
    bind_list: Optional[List[BindData]]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class GetBindTicketRsp(BaseModel):
    prompts: str
    status: int
    message: str
    data: GetBindTicketData
    ...


# noinspection PyPep8Naming, PyShadowingNames
class GetLogOffStatusResp(BaseModel):
    prompts: str
    status: int
    message: str
    data: GetLogOffStatusData
    ...


# noinspection PyPep8Naming, PyShadowingNames
class GetAppUpdateDataResp(BaseModel):
    prompts: str
    status: int
    message: str
    data: AppUpdateData
    ...


# noinspection PyPep8Naming, PyShadowingNames
class FWBusiness(BaseModel):
    icon: Optional[str]
    name: Optional[str]
    short_name: Optional[str]
    fw_business_type: Optional[int]
    business_text_icon: Optional[str]
    fw_business_order: Optional[int]
    fw_account_list: Optional[List[UserFWAccount]]
    entrance_sub_type: Optional[int]
    entrance_agreement: Optional[EntranceAgreement]
    is_auth: Optional[int]
    entrance_type: Optional[int]
    web_login_url: Optional[str]
    web_index_url: Optional[str]
    app_key: Optional[str]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class ExternalBusiness(BaseModel):
    icon: str
    name: str
    short_name: str
    fw_business_type: int
    entrance_sub_type: int
    fw_account_list: List[UserFWAccount]
    is_auth: int
    auth_access: AuthAccess
    entrance_agreement: EntranceAgreement
    desc: str
    ...


# noinspection PyPep8Naming, PyShadowingNames
class GetBindInfoRsp(BaseModel):
    prompts: str
    status: int
    message: str
    data: GetBindInfoData
    ...


# noinspection PyPep8Naming, PyShadowingNames
class UserFWAccountData(BaseModel):
    user_info: Optional[FWUser]
    fw_business_list: Optional[List[FWBusiness]]
    show_add_button: Optional[bool]
    add_button_jump_url: Optional[str]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class ExternalBusinessData(BaseModel):
    business_list: List[ExternalBusiness]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class GetUserFWAccountRsp(BaseModel):
    prompts: str
    status: int
    message: str
    data: Optional[UserFWAccountData]
    ...


# noinspection PyPep8Naming, PyShadowingNames
class GetExternalBusinessRsp(BaseModel):
    prompts: str
    status: int
    message: str
    data: ExternalBusinessData
    ...
